home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk3 / structures / macros.basic next >
Text File  |  1995-03-18  |  3KB  |  85 lines

  1. *--------------------------------------------------------------
  2. * Common MACROs that should be called for any and all programs
  3. *
  4. * Include macros.opt for optional MACRO and subroutine calls.
  5. *--------------------------------------------------------------
  6.  
  7. *--------------------------------------------------------------
  8. * use - sets a variable that will be checked when "macros.opt"
  9. *    is included. This allows selective inclusion of MACROs
  10. *    and subroutines contained in "macros.opt".
  11. *--------------------------------------------------------------
  12.  
  13. use    MACRO
  14. \1    SET    1
  15.     ENDM
  16.  
  17. *****************************************************************
  18. * Currently defined names for MACROs and subroutines for "use".
  19. *
  20. * ---------------------------------------------------------------
  21. * NAME   |  Routine(s) included
  22. * ---------------------------------------------------------------
  23. * b2h    | binhex   -- convert binary longword to ASCII hex string.
  24. *        |
  25. * copy   | copyb    -- memory to memory byte copy
  26. *        |
  27. * dbug   | regdump  -- Dump registers to data area in hex ASCII
  28. *        | shoregs  -- Print register dump area
  29. *        |
  30. * ins    | instr    -- Find occurence of string in another string.
  31. *        |
  32. * leadspc| ldspc    -- Replace leading zeros in string with spaces.
  33. *        |
  34. * libs   | openlib  -- opens a library
  35. *        | closelib -- closes a library
  36. *        | setlib   -- Library pointer to A6
  37. *        | dolibs   -- Open all libraries specified by USE
  38. *        |
  39. * prt    | print    -- print string to screen
  40. *        |
  41. * scm    | strcmp   -- compare 2 strings
  42. *        |
  43. * sln    | strlen   -- find length of a string
  44. ******************************************************************
  45.  
  46. *--------------------------------------------------------------
  47. * call - allows use of system calls (library subroutines) 
  48. *     without having to type _LVO all the time.
  49. *--------------------------------------------------------------
  50.  
  51. call    MACRO
  52.     jsr    _LVO\1
  53.     ENDM
  54.  
  55. *--------------------------------------------------------------
  56. * XTRN - Same reason as above. I hate unnecessary typing!
  57. *--------------------------------------------------------------
  58.  
  59. XTRN    MACRO
  60.     XREF    _LVO\1
  61.     ENDM
  62.  
  63. *--------------------------------------------------------------
  64. *  PUSHes and POPs - For a more intuitive and easy to type
  65. *            stack operation.
  66. *--------------------------------------------------------------
  67.  
  68. pushw    MACRO
  69.     move.w    \1,-(sp)    ;push a word onto stack
  70.     ENDM
  71.  
  72. pushl    MACRO
  73.     move.l    \1,-(sp)    ;push a longword onto stack
  74.     ENDM
  75.  
  76. popw    MACRO
  77.     move.w    (sp)+,\1    ;pop a word from stack
  78.     ENDM
  79.  
  80. popl    MACRO
  81.     move.l    (sp)+,\1    ;pop a longword from stack
  82.     ENDM
  83.  
  84. *--------------------------------------------------------------
  85.